/*    */ package dm.jdbc.driver;
/*    */ 
/*    */ import dm.jdbc.dbaccess.DBError;
/*    */ import dm.jdbc.dbaccess.DmMsgSend;
/*    */ import dm.jdbc.desc.ParameterDesc;
/*    */ import dm.sql.ARRAY;
/*    */ import dm.sql.TypeData;
/*    */ import dm.sql.TypeDescriptor;
/*    */ import java.sql.SQLException;
/*    */ 
/*    */ public class DmARRAYBinder extends DmBinder
/*    */ {
/*    */   public DmARRAYBinder(DmdbPreparedStatement_bs pstmt)
/*    */   {
/* 15 */     super(pstmt);
/*    */   }
/*    */   
/*    */   void init() {
/* 19 */     this.recDType = 117;
/* 20 */     this.recPrec = 0;
/* 21 */     this.recScale = 0;
/*    */   }
/*    */   
/*    */   void checkType(int icol, boolean forBatch) {
/* 25 */     if (this.m_checkType) {
/* 26 */       return;
/*    */     }
/* 28 */     this.m_checkType = true;
/*    */     
/* 30 */     if (this.paramsDesc == null) {
/* 31 */       this.paramsDesc = this.pstmt.getParamsDesc();
/*    */     }
/* 33 */     this.destDType = this.paramsDesc[icol].getDType();
/* 34 */     this.destPrec = this.paramsDesc[icol].getPrec();
/* 35 */     this.destScale = this.paramsDesc[icol].getScale();
/* 36 */     this.destIoType = this.paramsDesc[icol].getIOType();
/*    */   }
/*    */   
/*    */   public int bindData(DmMsgSend msg, int irow, int icol, boolean forBatch) throws SQLException
/*    */   {
/* 41 */     ARRAY x = ((ARRAY[])this.pstmt.m_paramObjects[icol])[irow];
/* 42 */     TypeDescriptor typeDesc = this.paramsDesc[icol].getTypeDescriptor();
/* 43 */     byte[] ret = null;
/*    */     
/* 45 */     switch (this.destDType) {
/*    */     case 122: 
/* 47 */       ret = TypeData.sarrayToBytes(x, typeDesc);
/* 48 */       break;
/*    */     
/*    */     case 117: 
/* 51 */       ret = TypeData.arrayToBytes(x, typeDesc);
/* 52 */       break;
/*    */     
/*    */     default: 
/* 55 */       DBError.throwSQLException(6007);
/*    */     }
/*    */     
/* 58 */     return msg.appendBytesWithLen2(ret, 0, ret.length);
/*    */   }
/*    */ }


/* Location:              D:\Program Files\DBMS_20150813\jdbc\Dm7JdbcDriver17.jar!\dm\jdbc\driver\DmARRAYBinder.class
 * Java compiler version: 2 (46.0)
 * JD-Core Version:       0.7.1
 */